/*********************************************************************
	\file :           os_sw_layers\bios\services\scheduler\Os_TaskCfg.h
	\brief:           Provide os tasks configuration support.
	\author:          Manuel Sandoval
	\version:         1.0
	\date:            Sat, 01, March 2014
*********************************************************************/

#ifndef Os_TaskCfg_H
#define Os_TaskCfg_H

/******************************* Includes**********************************/

#include "Os_Types.h"

/******************************* Defines **********************************/


#define CNF_NONE_MASK             0           /*!< Task 1 Mask. */
#define CNF_NONE_OFFSET           0           /*!< Task 1 Mask. */
#define CNF_NONE_PRIORITY 		  0			  /*!< Task 1 Offset. */
#define CNF_INVALID_TASK 		  0			  /*!< Task 1 Offset. */


#define CNF_TASKS_PRIORITY_1 			1			/*!< Task 1 Offset. */
#define CNF_TASKS_PRIORITY_2 			2			/*!< Task 2 Offset. */
#define CNF_TASKS_PRIORITY_3 			3			/*!< Task 3 Offset. */
#define CNF_TASKS_PRIORITY_4 			4			/*!< Task 4 Offset. */
#define CNF_TASKS_PRIORITY_5 			5			/*!< Task 5 Offset. */
#define CNF_TASKS_PRIORITY_6 			6			/*!< Task 6 Offset. */


#define CNF_TASKS_1_MS_OFFSET 			0			/*!< Task 1 Offset. */
#define CNF_TASKS_4_MS_OFFSET 			1			/*!< Task 2 Offset. */
#define CNF_TASKS_8_MS_OFFSET 			3			/*!< Task 3 Offset. */
#define CNF_TASKS_16_MS_OFFSET 			7			/*!< Task 4 Offset. */
#define CNF_TASKS_32_MS_OFFSET 			15			/*!< Task 5 Offset. */
#define CNF_TASKS_64_MS_OFFSET 			31			/*!< Task 6 Offset. */



#define CNF_TASKS_1_MS_MASK             1           /*!< Task 1 Mask. */
#define CNF_TASKS_4_MS_MASK             3           /*!< Task 2 Mask. */
#define CNF_TASKS_8_MS_MASK             7           /*!< Task 3 Mask. */
#define CNF_TASKS_16_MS_MASK            15          /*!< Task 4 Mask. */
#define CNF_TASKS_32_MS_MASK            31          /*!< Task 5 Mask. */
#define CNF_TASKS_64_MS_MASK            63          /*!< Task 6 Mask. */


/******************************* Enumerations******************************/


/******************************* Structures *******************************/

/** Task Control Block configuration.  */
typedef struct Os_TaskControlBlockType
{

	Os_TaskIDType 		  TaskId;							/*!< Task Id. */
	u8 					        TaskPriority;					/*!< Task Priority. */
	u8 					        TaskState;		 				/*!< Task state */
	// Os_StackType		StackInfo						/*!< Task stack information */
	// Os_DeadLineType	TaskDeadLine					/*!< Task Dead Line */
} Os_TaskControlBlockType;



/** Task Control Block configuration.  */
typedef struct Os_TaskDescriptorType
{

	Os_TaskIDType 		TaskId;							/*!< Task Id. */
	u8 					TaskPriority;					/*!< Task Priority. */
	u8 					TaskMask;						/*!< Mask of the task. */
	u8 					TaskOffset;						/*!< Offset for the task */
	// Os_StackSizeType		TaskStackSize					/*!< Task stack size */
	// Os_ReDeadLineType	TaskReDeadLine				/*!< Task Relative Dead Line */
	tCallbackFn 		TaskCallbackFunction;			/*!< Task Callback function. */
} Os_TaskDescriptorType;




/******************************* Global Variables **********************************/


extern Os_TaskDescriptorType Os_Tasks_Config[TASK_MAX_NUM];		/*!< Scheduler Tasks configuration. */


/******************************* Functions ********************************/


/** @} *//* End of Scheduler configuration Group */

#endif /* Os_TaskCfg_H */

/*********************************************************************
	File	: os_sw_layers\bios\services\scheduler\SchM_Cfg.h
*********************************************************************/
